<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改项目经历')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-project-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" type="hidden" id="id" th:value="${project.ID}"/>
        <h4 class="form-header h4">项目经历</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>开始时间：</label>
                    <div class="col-sm-8">
                        <input name="BeginDate" id="BeginDate"th:value="${project.BeginDate}" class="form-control laydate-demo-1" type="text" required/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">结束时间：</label>
                    <div class="col-sm-8">
                        <input name="EndDate" id="EndDate"th:value="${project.EndDate}" class="form-control laydate-demo-2" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"><span style="color: red; ">*</span>项目名称：</label>
                    <div class="col-sm-8">
                        <input name="ProjName" id="ProjName"th:value="${project.ProjName}" class="form-control" type="text" required/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">项目描述：</label>
                    <div class="col-sm-8">
                        <input name="Description" id="Description"th:value="${project.Description}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">担任职务：</label>
                    <div class="col-sm-8">
                        <input name="Job" id="Job"th:value="${project.Job}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">项目地址：</label>
                    <div class="col-sm-8">
                        <input name="ProjAddress" id="ProjAddress"th:value="${project.ProjAddress}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>


        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">项目负责人：</label>
                    <div class="col-sm-8">
                        <input name="Principal" id="Principal"th:value="${project.Principal}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input name="Remark" id="Remark"th:value="${project.Remark}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "entryManage/EntryBackground";

    $(function () {

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-3',
                type: 'date'
            });
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-4',
                type: 'date'
            });
        });
    });

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-project-edit").serializeArray();

            var id = $("#id").val();
            var BeginDate = $("#BeginDate").val();
            var EndDate = $("#EndDate").val();
            var ProjName = $("#ProjName").val();
            var Description = $("#Description").val();
            var Job = $("#Job").val();
            var ProjAddress = $("#ProjAddress").val();
            var Principal = $("#Principal").val();
            var Remark = $("#Remark").val();

            data.push({"name": "id", "value": id});
            data.push({"name": "BeginDate", "value": BeginDate});
            data.push({"name": "EndDate", "value": EndDate});
            data.push({"name": "ProjName", "value": ProjName});
            data.push({"name": "Description", "value": Description});
            data.push({"name": "Job", "value": Job});
            data.push({"name": "ProjAddress", "value": ProjAddress});
            data.push({"name": "Principal", "value": Principal});
            data.push({"name": "Remark", "value": Remark});

            $.operate.save(prefix + "/editProject", data);

        }
    }


</script>
</body>
</html>
